# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=kmon
pkgver=1.6.0
pkgrel=0
pkgdesc="Linux Kernel Manager and Activity Monitor"
arch="all !s390x !riscv64" # limited by cargo
url="https://kmon.cli.rs/"
license="GPL-3.0-or-later"
depends="kmod util-linux-misc" # dmesg
makedepends="cargo python3 libxcb-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/orhun/kmon/archive/refs/tags/v$pkgver.tar.gz"

prepare() {
	default_prepare
	cargo fetch --locked
}

build() {
	cargo build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm0755 target/release/kmon -t "$pkgdir"/usr/bin
	install -Dm0644 man/kmon.8 "$pkgdir"/usr/share/man/man8/kmon.8
}

sha512sums="
3b40f19ed42a8f1c1f65fa3306a77b4861bc53191a878c2ec18dd36a4ed58aecb534a19e73aa5be3ed54b99f02ace1622b5b5e90353d1a2a055e83eccde81b76  kmon-1.6.0.tar.gz
"
